< previous page page_333 next page >

Page 333
To illustrate these points, an order of events is shown as an example in the Debug2.frm sample form. In this program, you see output in the Immediate window from many of the different events. Heres a listing of some of the more common ones:
9f31265bb40b592b1929e18a47ab28e5.gif
Private Sub txtName_Click ()
   Debug.Print "txtName_Click"
End Sub

Private Sub txtName_MouseDown (Button As Integer, _
           Shift As Integer,    X As Single, Y As Single)
   Debug.Print "txtName_MouseDown"
End Sub

Private Sub txtName_MouseMove (Button As Integer, _
           Shift As Integer, X As Single, Y As Single)
   Debug.Print "txtName_MouseMove"
End Sub

Private Sub txtName_MouseUp (Button As Integer, _
           Shift As Integer, X As Single, Y As Single)
   Debug.Print "txtName_MouseUp"
End Sub
Move your mouse around and click the different controls to see the effects of the events being fired.
Summary
This chapter presented you with the different features of the integrated debugging environment in Visual Basic. This powerful tool helps you track down bugs very easily. By setting breakpoints, inspecting the values of variables, and stepping through your code line by line, you can debug your application much more efficiently.
Review Questions
1. What are the three modes in Visual Basic?
2. Which key marks a line as a breakpoint?
3. Which statement prints values from the Immediate window when the application is in break mode?

 
< previous page page_333 next page >

If you like this book, buy it!